/*
 *  This file is part of WWWPal.
 *
 *  Copyright (C) 2003  Dr. John Punin, Department of Computer Science
 *  Rensselaer Polytechnic Institute
 *
 *  WWWPal is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  WWWPal is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Foobar; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

/*
 *  This file is part of WWWPal.
 *
 *  Copyright (C) 2003  Dr. John Punin, Department of Computer Science
 *  Rensselaer Polytechnic Institute
 *
 *  WWWPal is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  WWWPal is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Foobar; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
#ifndef LOGR_USERS_H
#define LOGR_USERS_H

#include <sys/stat.h>
#include <sys/fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <ctype.h>
#include <sys/time.h>
#include <assert.h>
#include <gr_graph_fun.h>


#include "LOGR_paths.h"

typedef struct _web_user_node {
    char *uname;
    long naccesses;
    time_t startt;
    time_t endt;
    char *referer;
    char *epage;
    LNode_type *lepages;
    void *info;
    WebPathPtr cpath;
    LNode_type *ltimes;
} WebUserStruct;

typedef struct _web_user_node *WebUserPtr;

WebUserPtr
new_web_user_node(void);

void
delete_web_user_node(WebUserPtr opn);

void
LOGR_set_user_naccesses(WebUserPtr usn,long num);

void
LOGR_inc_user_naccesses(WebUserPtr usn);

long
LOGR_get_user_naccesses(WebUserPtr usn);

void
LOGR_set_user_name(WebUserPtr usn,char *name);

char *
LOGR_get_user_name(WebUserPtr usn);

void
LOGR_set_user_start_time(WebUserPtr usn,time_t stime);

time_t
LOGR_get_user_start_time(WebUserPtr usn);

void
LOGR_set_user_end_time(WebUserPtr usn,time_t etime);

time_t
LOGR_get_user_end_time(WebUserPtr usn);

void
LOGR_set_user_info(WebUserPtr usn,void * info);

void *
LOGR_get_user_info(WebUserPtr usn);

void
LOGR_set_user_referer(WebUserPtr usn,char *referer);

void
LOGR_delete_user_referer(WebUserPtr usn);

char *
LOGR_get_user_referer(WebUserPtr usn);

void
LOGR_set_user_entry_page(WebUserPtr usn,char *entry_page);

void
LOGR_delete_user_entry_page(WebUserPtr usn);

char *
LOGR_get_user_entry_page(WebUserPtr usn);

const char *
LOGR_get_user_entry_page_title(WebUserPtr usn,GraphFrame *gf);

void
LOGR_set_user_ltimes(WebUserPtr upn,LNode_type * ltimes);

void
LOGR_add_user_time(WebUserPtr upn,void *time);

LNode_type *
LOGR_get_user_ltimes(WebUserPtr upn);

WebPathPtr
LOGR_get_user_current_path(WebUserPtr usn);

void
LOGR_set_user_current_path(WebUserPtr usn,WebPathPtr cpath);

WebUserPtr 
LOGR_new_web_user_info(char *dns, char *urls, char *urlt);

void
LOGR_set_user_lepages(WebUserPtr usn,LNode_type * lepages);

void
LOGR_add_user_entry_page(WebUserPtr usn,void *gen_page);


LNode_type *
LOGR_get_user_lepages(WebUserPtr usn);

#endif

